package com.anycl.design.behavioral.responsibility;

import java.util.ArrayList;

public class Main {

    public static void main(String[] args) {
        ArrayList<IRequest> requests = new ArrayList<>();
        requests.add(new Request(Handler.DIFFICULTY_LEVEL_1_REQUEST, "1+1=?"));
        requests.add(new Request(Handler.DIFFICULTY_LEVEL_2_REQUEST, "3*4=?"));
        requests.add(new Request(Handler.DIFFICULTY_LEVEL_3_REQUEST, "3123*123=?"));
        requests.add(new Request(4, "3123*123*12312=?"));

        Handler primary = new Primary();
        Handler middle = new Middle();
        Handler senior = new Senior();

        primary.setNextHandler(middle);
        middle.setNextHandler(senior);
        for (IRequest request: requests)
            primary.handleMessage(request);
    }
}
